package com.example.user_service.dao;

import com.example.user_service.vo.Administrator;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface UserUpdate
{
    /* 修改管理员数据
     * @author Liu
     * @date 2021/12/15 2:19
     * @param null
     * @return
     * @throws
     * @since
     */
    @Update("update administrator set account='${account}' , pawd='${pawd}' , role='${role_name}' where id = ${id}")
    int update_Administrator(Administrator administrator);

    /* 修改管理员状态
     * @author Liu
     * @date 2021/12/15 2:19
     * @param null
     * @return
     * @throws
     * @since
     */
    @Update("update administrator set state = ${state} where id = ${id}")
    int update_Administrator_state(Administrator administrator);

    /**
     * gfc 修改登录时间
     * @param userid
     * @return
     */
    @Update("update user_login set login_time = now() where user_id = #{userid}")
    int update_login_time(int userid);


    /* 修改用户积分
     * @author Liu
     * @date 2021/12/17 11:27
     * @param null
     * @return
     * @throws
     * @since
     */
    @Update("update user_member set member_existing_integral = member_existing_integral ${str} where user_id = #{userid}")
    int update_member_existing_integral(int userid, String str);
}
